<<<<<<< HEAD
<!--
 * @Author: Xia_cc 978487464@qq.com
 * @Date: 2022-06-10 11:34:58
 * @LastEditors: Xia_cc 978487464@qq.com
 * @LastEditTime: 2022-06-10 14:11:45
 * @FilePath: \vue 小U到家\src\views\Mainwuliaotongji.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!--  -->
<template>
  <el-container>
    <!-- 搜索框 -->
    <el-header>
      关键字:<el-input
        class="search"
        type="text"
        @change="selects()"
        placeholder="请输入内容"
        v-model="text"
      ></el-input>
      站点:<el-select
        class="search"
        @input="selects()"
        v-model="wuLiaoZhanDian"
        placeholder="请选择"
      >
        <el-option
          v-for="item in wuLiaoZhanDianArr"
          :key="item.value"
          :label="item.label"
          :value="item.value"
          size="mini"
        >
        </el-option>
      </el-select>
    </el-header>
    <!-- 弹出框 -->
    <el-dialog
      class="psyModle"
      title="添加物料"
      :visible.sync="wuLiaoAddVisible"
      width="37%"
      top="50px"
      center
    >
      <span class="psChaXunSpan">物料名称 </span
      ><el-input class="searchs" type="text" placeholder="请输入品类名称" v-model="text"></el-input>
      <span class="psChaXunSpan">物料单位 </span
      ><el-input class="searchs" type="text" placeholder="请输入序号" v-model="text"></el-input>
      <span class="psChaXunSpan">物料成本 </span
      ><el-input class="searchs" type="text" placeholder="请输入序号" v-model="text"></el-input>
      <span slot="footer" class="dialog-footer">
        <el-button @click="wuLiaoAddVisible = false">取 消</el-button>
        <el-button type="primary" @click="wuLiaoAddVisible = false">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 显示表 -->
    <el-main>
      <el-row>
        <el-button @click="wuLiaoAddVisible = true" type="primary" plain>添加</el-button>
        <el-button @click="psyDelBut()" type="danger" plain>删除</el-button>
      </el-row>
      <Maintable :tableData="wuliaoArr">
        <template v-slot:tableline>
          <el-table-column prop="materials_name" label="物料名称" width="120"> </el-table-column>
          <el-table-column prop="materials_num" label="库存数量" width="120"> </el-table-column>
          <el-table-column prop="materials_unit" label="单位" width="120"> </el-table-column>
          <el-table-column prop="materials_cost" label="单间成本（元）" width="120">
          </el-table-column>
          <el-table-column prop="materials_price" label="单价（元）" width="120"> </el-table-column>
          <el-table-column prop="total_cost" label="总成本（元）" width="120"> </el-table-column>
          <el-table-column prop="site_name" label="所属站点" width="120"> </el-table-column>
        </template>
        <template v-slot:chaozuo>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button
                type="success"
                slot="reference"
                plain
                icon="el-icon-view"
                title="查看"
                @click="chakan(scope.row.id)"
              >
              </el-button>
            </template>
          </el-table-column>
        </template>
      </Maintable>
    </el-main>
    <el-footer>
      <div class="block">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage"
          :page-sizes="[6, 8, 10, 12]"
          :page-size="100"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </el-footer>
  </el-container>
</template>

<script>
import Maintable from "../components/main/Maintable";
export default {
  name: "wuliaotongji",
  components: {
    Maintable,
  },
  computed: {},
  data() {
    return {
      text: "",
      size: 6,
      page: 1,
      total: 0,
      wuliaoArr: [],
      currentPage: 1,
      wuLiaoZhanDian: "",
      wuLiaoZhanDianArr: JSON.parse(window.localStorage.getItem("allzhandianArr")),
      wuLiaoAddVisible: false,
      peiSongYuanTraffic: "面包车/电瓶车", //交通工具
      peiSongYuanOrigin: "青羊区", //来源
      peiSongYuanSex: "男", //性别
      peiSongYuanZhuangTai: "", //状态
      centerDialogVisible: false,
    };
  },
  methods: {
    handleSizeChange(val) {
      this.size = val;
      console.log(`每页 ${val} 条`);
      this.selects();
    },
    handleCurrentChange(val) {
      this.page = val;
      console.log(`当前页: ${val}`);
      this.selects();
    },
    //获取页面数据
    selects() {
      // console.log(this.text);
      this.$axios({
        method: "post",
        url: "/xiaoucomeshome_war/usermanager/selectMaterialsAll",
        data: {
          materials_name: this.text,
          page: this.page,
          size: this.size,
          site_id: this.wuLiaoZhanDian,
        },
      })
        .then((response) => {
          this.total = response.data.total;
          this.wuliaoArr = response.data.data;
          // console.log(response.data);
        })
        .catch((error) => {
          console.log(error);
        });
    },
  },
  mounted() {
    this.selects();
  },
};
</script>

<style lang="less" scoped>
.search {
  margin: 10px 40px 0 20px;
  width: 20%;
}
.block {
  margin: 0 130px;
  float: right;
}
</style>
=======
<!--
 * @Author: Xia_cc 978487464@qq.com
 * @Date: 2022-06-10 11:34:58
 * @LastEditors: Xia_cc 978487464@qq.com
 * @LastEditTime: 2022-06-10 14:11:45
 * @FilePath: \vue 小U到家\src\views\Mainwuliaotongji.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!--  -->
<template>
  <el-container>
    <!-- 搜索框 -->
    <el-header>
      关键字:<el-input class="search" type="text" placeholder="请输入内容" v-model="text"></el-input>
      站点:<el-select class="search" v-model="wuLiaoZhanDian" placeholder="请选择">
        <el-option v-for="item in wuLiaoZhanDianArr" :key="item.WLvalue" :label="item.WLlabel" :value="item.WLvalue"
          size="mini">
        </el-option>
      </el-select>
    </el-header>
     <!-- 弹出框 -->
        <el-dialog class="psyModle" title="添加物料" :visible.sync="wuLiaoAddVisible" width="37%" top="50px" center>
            <span class="psChaXunSpan">物料名称 </span><el-input class="searchs" type="text" placeholder="请输入品类名称" v-model="text"></el-input>
            <span class="psChaXunSpan">物料单位 </span><el-input class="searchs" type="text" placeholder="请输入序号" v-model="text"></el-input>
           <span class="psChaXunSpan">物料成本 </span><el-input class="searchs" type="text" placeholder="请输入序号" v-model="text"></el-input>
            <span slot="footer" class="dialog-footer">
                <el-button @click="wuLiaoAddVisible = false">取 消</el-button>
                <el-button type="primary" @click="wuLiaoAddVisible = false">确 定</el-button>
            </span>
        </el-dialog>
    <!-- 显示表 -->
    <el-main>
      <!-- <el-row>
        <el-button @click="wuLiaoAddVisible = true" type="primary" plain>添加</el-button>
        <el-button @click="psyDelBut()" type="danger" plain>删除</el-button>
      </el-row> -->
      <Maintable>
        <template v-slot:tableline>
          <el-table-column prop="date" label="物料名称" width="120"> </el-table-column>
          <el-table-column prop="name" label="库存数量" width="120"> </el-table-column>
          <el-table-column prop="date" label="单位" width="120"> </el-table-column>
          <el-table-column prop="date" label="单间成本（元）" width="120"> </el-table-column>
          <el-table-column prop="date" label="单价（元）" width="120"> </el-table-column>
          <el-table-column prop="date" label="总成本（元）" width="120"> </el-table-column>
          <el-table-column prop="date" label="所属站点" width="120"> </el-table-column>
        </template>
        <template v-slot:chaozuo>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button type="success" slot="reference" plain icon="el-icon-view" title="查看"
                @click="updates(scope.row.id)">
              </el-button>
            </template>
          </el-table-column>
        </template>
      </Maintable>
    </el-main>
  </el-container>
</template>

<script>
import Maintable from "../components/main/Maintable";
export default {
name:'wuliaotongji',
components: {
    Maintable
},
computed:{},
data () {
    return {
         text:'',
            peiSongYuanTraffic: '面包车/电瓶车',  //交通工具
            peiSongYuanOrigin:'青羊区',    //来源
            peiSongYuanSex: '男',   //性别
            peiSongYuanZhuangTai: '',   //状态
            centerDialogVisible: false, 
   }
 },
methods:{}
}
</script>

<style lang='less' scoped>
.search {
  margin: 10px 40px 0 20px;
  width: 20%;
}
</style>
>>>>>>> ae27e4fe2d4f939d0b0ee2bfa506b9e3269c53cb
